package com.amazon.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.amazon.dao.EUserDao;
import com.amazon.dao.UserDao;
import com.amazon.model.EUser;
import com.amazon.model.User;
import com.amazon.service.UserService;
@Service("userService")
public class UserServiceImpl implements UserService{
	
	private UserDao userDao;
	private EUserDao euserDao;
	@Override
	@Transactional
	public void addUser(User user) throws Exception {
		// TODO Auto-generated method stub
		User user1=new User();
		EUser euser=new EUser();
		user1.setUserName("aa");
		user1.setUserStatus("aa");
		euser.setUserName("aa");
		euser.setUserStatus("aa");
		userDao.insert(user);
		euserDao.insert(euser);
		throw new RuntimeException();
	}
	@Transactional
	public User getUserById(long id){
		return userDao.getById(1);
	}
	public UserDao getUserDao() {
		return userDao;
	}
	@Resource
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
	public EUserDao getEUserDao() {
		return euserDao;
	}
	@Resource
	public void setEUserDao(EUserDao euserDao) {
		this.euserDao = euserDao;
	}
	
}